package com.css.security.core.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
import org.springframework.stereotype.Component;

/**
 * LogSessionSecurityConfig
 *
 * @author hanyx
 * @date 2019/06/13
 */
@Slf4j
@Component
public class LogSessionSecurityConfig extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {

    @Autowired
    private LogSessionFilter logSessionFilter;

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.addFilterAfter(logSessionFilter, FilterSecurityInterceptor.class);
    }
}
